import request from '@/utils/request'

// 查询列表
export function listDict(query) {
  return request({
    url: '/business/dict/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getDict(id) {
  return request({
    url: '/business/dict/' + id,
    method: 'get'
  })
}

// 新增
export function addDict(data) {
  return request({
    url: '/business/dict',
    method: 'post',
    data: data
  })
}

// 新增 工具按鈕
export function addDictOther(data) {
  return request({
    url: '/business/dict/autoadd',
    method: 'post',
    data: data
  })
}

// 修改
export function updateDict(data) {
  return request({
    url: '/business/dict',
    method: 'put',
    data: data
  })
}

// 删除
export function delDict(id) {
  return request({
    url: '/business/dict/' + id,
    method: 'delete'
  })
}

export function getInfo(data) {
  return request({
    url: '/business/dict/getInfo',
    method: 'post',
    data: data
  })
}

// 清除缓存
export function refreshCache(id) {
  return request({
    url: '/business/dict/refreshCache',
    method: 'get'
  })
}

export function getGameDictToExport(dictCodeId) {
  return request({
    url: '/business/dict/getGameDictToExport/' + dictCodeId,
    method: 'get'
  })
}

export function pushIdsApi(ids) {
  return request({
    url: '/system/data/pushAttributes/' + ids,
    method: 'get'
  })
}


// 获取平台
export function getPlatsApi(ids) {
  return request({
    url: '/system/data/platformName',
    method: 'get'
  })
}

// 获取平台
export function getPlatformAttrApi(data) {
  return request({
    url: '/system/data/list',
    method: 'get',
    params: data
  })
}


// 获取平台
export function pullingAttrAPi(data) {
  return request({
    url: '/system/data/pullingAttr',
    method: 'post',
    data
  })
}


// 根据游戏获取属性
export function getGameAttrByDictCodeApi(data) {
  return request({
    url: '/business/dict/getGameAttrByDictCode/' + data,
    method: 'get',
  })
}

// 根据游戏获取属性
export function addHiddenApi(data) {
  return request({
    url: '/system/data/addHidden/' + data,
    method: 'get',
  })
}

// 查询被隐藏的属性
export function getHiddenApi(data) {
  return request({
    url: '/system/data/getHidden',
    method: 'get',
    params:data
  })
}



